<template>
  <div class="hello">
    <el-input :placeholder="$t('common.form.input', [$t('common.name.tel')])"></el-input>
    <el-select
      v-model="locale"
      :placeholder="$t('common.form.select', [null])"
      @change="handleChange"
    >
      <el-option label="中文" value="zh_CN"></el-option>
      <el-option label="English" value="en_US"></el-option>
    </el-select>
    <br />
    <br />
    <br />
    <el-button-group>
      <el-button type="primary">{{$t('common.operate.delete')}}</el-button>
      <el-button type="info">{{$t('common.operate.confirm')}}</el-button>
    </el-button-group>
    {{btn}}
  </div>
</template>

<script>
export default {
  name: "HelloWorld",
  data() {
    return {
      name: "www",
      s: ""
    };
  },
  computed: {
    locale: {
      get() {
        return this.$store.state.locale;
      },
      set(val) {
        this.$store.state.locale = val;
      }
    },
    btn() {
      return this.$t("common.operate.delete");
    }
  },
  methods: {
    handleChange(val) {
      this.$store.dispatch("changeLan", val);
    }
  }
};
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
h3 {
  margin: 40px 0 0;
}
ul {
  list-style-type: none;
  padding: 0;
}
li {
  display: inline-block;
  margin: 0 10px;
}
a {
  color: #42b983;
}
</style>
